package com.xk.springboot.utils;

import com.xk.springboot.dto.ResponseData;
import com.xk.springboot.dto.ResultData;
import org.springframework.validation.BindingResult;
import org.springframework.validation.ObjectError;

import javax.xml.ws.Response;
import java.util.List;

public class Error {

    public ResultData allError(BindingResult result){
        String errors = "";
        List<ObjectError> allErrors = result.getAllErrors();
      return ResponseData.error(10001,errors);
    }
}
